package com.wangyadong.hobby.schedule.jobtask.jvm;

/**
 * <p>
 *
 * @author <714037465@qq.com>
 * @since 2018/11/2315:41
 **/
public class DynamicDispatch {

    abstract static class Human {
        protected abstract void sayHello();
    }

    static class Men extends Human {
        @Override
        protected void sayHello() {
            System.out.println("the Man say hello");
        }
    }

    static class Women extends Human {
        @Override
        protected void sayHello() {
            System.out.println("the women say hello");
        }
    }

    public static void main(String[] args) {
        Human man = new Men();
        Human women = new Women();
        man.sayHello();
        women.sayHello();
        man = new Women();
        man.sayHello();
        DynamicDispatch dynamicDispatch = new DynamicDispatch();

    }


}
